{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "0db58db5-d4ee-4631-af5b-4fc53eb05170",
   "metadata": {},
   "source": [
    "# RAG with Excel Spreadsheet using LlamaPrase\n",
    "\n",
    "<a href=\"https://colab.research.google.com/github/run-llama/llama_parse/blob/main/examples/demo_excel.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>\n",
    "\n",
    "This notebook constructs a RAG pipeline over a simple DCF template [here](https://eqvista.com/app/uploads/2020/09/Eqvista_DCF-Excel-Template.xlsx).\n",
    "\n"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "5f7d99ad-6ebd-47d0-92a7-566630b0c22a",
   "metadata": {},
   "source": [
    "## Setup\n",
    "\n",
    "We first setup and load the data. If you haven't already, [download the template](https://eqvista.com/app/uploads/2020/09/Eqvista_DCF-Excel-Template.xlsx) and name it `dcf_template.xlxs` locally."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "d867d1a6-cfcf-4f53-952a-f4a6ff2fa205",
   "metadata": {},
   "outputs": [],
   "source": [
    "%pip install llama-index\n",
    "%pip install llama-parse"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "103c7983-56d3-45be-b763-d1828d07c43e",
   "metadata": {},
   "outputs": [],
   "source": [
    "import nest_asyncio\n",
    "\n",
    "nest_asyncio.apply()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "7b694b56-e04b-4d87-aa37-f0725d6b3adb",
   "metadata": {},
   "outputs": [],
   "source": [
    "from llama_parse import LlamaParse\n",
    "\n",
    "# api_key = \"llx-\"  # get from cloud.llamaindex.ai"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "9c4693c7-c1c8-47b4-8a8c-25d7e9ef9d2c",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Started parsing the file under job_id cac11eca-d5da-4d46-90e6-321f40e11611\n",
      "Started parsing the file under job_id cac11eca-5450-4847-9da0-fa6879c4cf3a\n"
     ]
    }
   ],
   "source": [
    "parser = LlamaParse(\n",
    "    # api_key=api_key,  # can also be set in your env as LLAMA_CLOUD_API_KEY\n",
    "    result_type=\"markdown\",\n",
    ")\n",
    "docs = parser.load_data(\"./dcf_template.xlsx\")\n",
    "# docs_txt = LlamaParse(result_type=\"text\").load_data(\"./dcf_template.xlsx\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "7302f1c8-e405-4cda-8ff7-1d55185816f7",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "# Cover Page\n",
      "\n",
      "|Thank you for downloading our DCF Model excel template. This DCF Model excel template helps you to value your business using Discounted Free Cash Flow or DCF Method. |                                                                                                                                                                                  |\n",
      "|----------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n",
      "|                                                                                                                                                                      |                                                                                                                                                                                  |\n",
      "|                                                                                                                                                                      |Eqvista is an equity management software that allows companies, investors and company shareholders to track, manage, and make intelligent decisions about their companies’ equity.|\n",
      "|                                                                                                                                                                      |                                                                                                                                                                                  |\n",
      "|                                                                                                                                                                      |GET STARTED- IT'S FREE                                                                                                                                                            |\n",
      "|                                                                                                                                                                      |                                                                                                                                                                                  |\n",
      "|                                                                                                                                                                      |Note: This template is not professional advice and not a substitute for professional advice.                                                                                      |\n",
      "|Accordingly, before taking any actions based upon such information, we encourage you to consult with the appropriate professionals.                                   |                                                                                                                                                                                  |\n",
      "|                                                                                                                                                                      |                                                                                                                                                                                  |\n",
      "|                                                                                                                                                                      |@Eqvista Inc. All Rights Reserved                                                                                                                                                 |\n",
      "---\n",
      "# DCF Model\n",
      "\n",
      "|Discounted Cash Flow Excel Template                                                                                                                                                        |                              |           |           |                       |           |                       |              |           |           |           |              |\n",
      "|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------|-----------|-----------|-----------------------|-----------|-----------------------|--------------|-----------|-----------|-----------|--------------|\n",
      "|                                                                                                                                                                                           |                              |           |           |                       |           |                       |              |           |           |           |              |\n",
      "|Here is a simple discounted cash flow excel template for estimating your company value based on this income valuation approach                                                             |                              |           |           |                       |           |                       |              |           |           |           |              |\n",
      "|                                                                                                                                                                                           |                              |           |           |                       |           |                       |              |           |           |           |              |\n",
      "|Instructions:                                                                                                                                                                              |                              |           |           |                       |           |                       |              |           |           |           |              |\n",
      "|1) Fill out the two assumptions in yellow highlight                                                                                                                                        |                              |           |           |                       |           |                       |              |           |           |           |              |\n",
      "|2) Fill in either the 5 year or 3 year weighted average figures in yellow highlight                                                                                                        |                              |           |           |                       |           |                       |              |           |           |           |              |\n",
      "|                                                                                                                                                                                           |                              |           |           |                       |           |                       |              |           |           |           |              |\n",
      "|Assumptions                                                                                                                                                                                |                              |           |           |                       |           |                       |              |           |           |           |              |\n",
      "|Tax Rate                                                                                                                                                                                   |20%                           |           |           |                       |           |                       |              |           |           |           |              |\n",
      "|Discount Rate                                                                                                                                                                              |15%                           |           |           |                       |           |                       |              |           |           |           |              |\n",
      "|                                                                                                                                                                                           |                              |           |           |                       |           |                       |              |           |           |           |              |\n",
      "|5 Year Weighted Moving Average                                                                                                                                                             |                              |           |           |                       |           |                       |              |           |           |           |              |\n",
      "|Indication of Company Value                                                                                                                                                                |$242,995.43                   |           |           |                       |           |                       |              |           |           |           |              |\n",
      "|                                                                                                                                                                                           |                              |           |           |                       |           |                       |              |           |           |           |              |\n",
      "|3 Year Weighted Moving Average                                                                                                                                                             |                              |           |           |                       |           |                       |              |           |           |           |              |\n",
      "|Indication of Company Value                                                                                                                                                                |$158,651.07                   |           |           |                       |           |                       |              |           |           |           |              |\n",
      "|                                                                                                                                                                                           |                              |           |           |                       |           |                       |              |           |           |           |              |\n",
      "|                                                                                                                                                                                           |5 Year Weighted Moving Average|           |           |                       |           |                       |              |           |           |           |              |\n",
      "|                                                                                                                                                                                           |Past Years                    |           |           |                       |           |Forecasted Future Years|              |           |           |           |              |\n",
      "|                                                                                                                                                                                           |Year 1                        |Year 2     |Year 3     |Year 4                 |Year 5     |Year 6                 |Year 7        |Year 8     |Year 9     |Year 10    |Terminal Value|\n",
      "|Pre-tax income                                                                                                                                                                             |50,000.00                     |55,000.00  |45,000.00  |52,000.00              |60,000.00  |                       |              |           |           |           |              |\n",
      "|Income Taxes                                                                                                                                                                               |10,000.00                     |11,000.00  |9,000.00   |10,400.00              |12,000.00  |                       |              |           |           |           |              |\n",
      "|Net Income                                                                                                                                                                                 |40,000.00                     |44,000.00  |36,000.00  |41,600.00              |48,000.00  |                       |              |           |           |           |              |\n",
      "|Depreciation Expense                                                                                                                                                                       |5,000.00                      |4,000.00   |3,000.00   |2,000.00               |1,000.00   |                       |              |           |           |           |              |\n",
      "|Capital Expenditures                                                                                                                                                                       |10,000.00                     |8,000.00   |5,000.00   |5,000.00               |7,000.00   |                       |              |           |           |           |              |\n",
      "|Debt Repayments                                                                                                                                                                            |5,000.00                      |5,000.00   |5,000.00   |5,000.00               |5,000.00   |                       |              |           |           |           |              |\n",
      "|Net Cash Flow                                                                                                                                                                              |20,000.00                     |27,000.00  |23,000.00  |29,600.00              |35,000.00  |29,093.33              |29,817.78     |30,177.48  |30,469.23  |30,379.74  |287,188.00    |\n",
      "|Discounting Factor                                                                                                                                                                         |                              |           |           |                       |           |0.8696                 |0.7561        |0.6575     |0.5718     |0.4972     |0.4972        |\n",
      "|Present Value of Future Cash Flow                                                                                                                                                          |                              |           |           |                       |           |25,298.55              |22,546.52     |19,842.18  |17,420.88  |15,104.10  |142,783.19    |\n",
      "|                                                                                                                                                                                           |                              |           |           |                       |           |                       |              |           |           |           |              |\n",
      "|                                                                                                                                                                                           |3 Year Weighted Moving Average|           |           |                       |           |                       |              |           |           |           |              |\n",
      "|                                                                                                                                                                                           |Past Years                    |           |           |Forecasted Future Years|           |                       |              |           |           |           |              |\n",
      "|                                                                                                                                                                                           |Year 1                        |Year 2     |Year 3     |Year 4                 |Year 5     |Year 6                 |Terminal Value|           |           |           |              |\n",
      "|Pre-tax income                                                                                                                                                                             |50,000.00                     |55,000.00  |45,000.00  |                       |           |                       |              |           |           |           |              |\n",
      "|Income Taxes                                                                                                                                                                               |10,000.00                     |11,000.00  |9,000.00   |                       |           |                       |              |           |           |           |              |\n",
      "|Net Income                                                                                                                                                                                 |40,000.00                     |44,000.00  |36,000.00  |                       |           |                       |              |           |           |           |              |\n",
      "|Depreciation Expense                                                                                                                                                                       |5,000.00                      |4,000.00   |3,000.00   |                       |           |                       |              |           |           |           |              |\n",
      "|Capital Expenditures                                                                                                                                                                       |10,000.00                     |8,000.00   |5,000.00   |                       |           |                       |              |           |           |           |              |\n",
      "|Debt Repayments                                                                                                                                                                            |5,000.00                      |5,000.00   |5,000.00   |                       |           |                       |              |           |           |           |              |\n",
      "|Net Cash Flow                                                                                                                                                                              |20,000.00                     |27,000.00  |23,000.00  |23,833.33              |24,083.33  |23,819.44              |158,253.59    |           |           |           |              |\n",
      "|Discounting Factor                                                                                                                                                                         |                              |           |           |0.8696                 |0.7561     |0.6575                 |0.6575        |           |           |           |              |\n",
      "|Present Value of Future Cash Flow                                                                                                                                                          |                              |           |           |20,724.64              |18,210.46  |15,661.67              |104,054.30    |           |           |           |              |\n",
      "|                                                                                                                                                                                           |                              |           |           |                       |           |                       |              |           |           |           |              |\n",
      "|Notes:                                                                                                                                                                                     |                              |           |           |                       |           |                       |              |           |           |           |              |\n",
      "|-We based this simple discounted cash flow excel model based on the weighted moving averages (5 year or 3 year) for simplicity, in case a constant growth rate cannot be easily determined.|                              |           |           |                       |           |                       |              |           |           |           |              |\n",
      "|-The factors such as Depreciation Expense, Capital Expense and Debt Repayments remain constant, so consider this when looking at the forecasted figures.                                   |                              |           |           |                       |           |                       |              |           |           |           |              |\n",
      "|-For the terminal value constant growth rate, we make the assumption of the growth from the last forecasted year compared to the first forecasted year. Adjust in the formula as needed.   |                              |           |           |                       |           |                       |              |           |           |           |              |\n",
      "\n"
     ]
    }
   ],
   "source": [
    "print(docs[0].get_content())"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "1aedd4bb-7939-4fbc-8f07-d362e24d9772",
   "metadata": {},
   "source": [
    "## Configure LLM, Setup Basic Summary Engine\n",
    "\n",
    "We setup a basic summary engine which retrieves the entire document as context to put into the prompt."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "f7c056a8-d098-4ebe-9341-d9f07081067c",
   "metadata": {},
   "outputs": [],
   "source": [
    "from llama_index.llms.openai import OpenAI\n",
    "from llama_index.core import Settings\n",
    "\n",
    "llm = OpenAI(model=\"gpt-4-turbo-preview\")\n",
    "Settings.llm = llm"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "c0fa2630-ee1b-4ce7-91e9-f9ffff8347f9",
   "metadata": {},
   "outputs": [],
   "source": [
    "from llama_index.core import SummaryIndex\n",
    "\n",
    "index = SummaryIndex.from_documents(docs)\n",
    "# index = SummaryIndex.from_documents(docs_txt)\n",
    "\n",
    "query_engine = index.as_query_engine()"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "1d39a075-46b8-4dcb-8aee-abd10343bedd",
   "metadata": {},
   "source": [
    "## Define Baseline\n",
    "\n",
    "Let's define a baseline query engine over this data, using a naive parser (our PandasExcelReader, available on LlamaHub)."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "632f918e-7811-4931-8a5f-4aa4850718db",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Collecting openpyxl\n",
      "  Downloading openpyxl-3.1.3-py2.py3-none-any.whl (251 kB)\n",
      "\u001b[2K     \u001b[38;2;114;156;31m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m251.3/251.3 kB\u001b[0m \u001b[31m5.0 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m MB/s\u001b[0m eta \u001b[36m0:00:01\u001b[0m\n",
      "\u001b[?25hCollecting et-xmlfile\n",
      "  Using cached et_xmlfile-1.1.0-py3-none-any.whl (4.7 kB)\n",
      "Installing collected packages: et-xmlfile, openpyxl\n",
      "Successfully installed et-xmlfile-1.1.0 openpyxl-3.1.3\n",
      "\n",
      "\u001b[1m[\u001b[0m\u001b[34;49mnotice\u001b[0m\u001b[1;39;49m]\u001b[0m\u001b[39;49m A new release of pip available: \u001b[0m\u001b[31;49m22.2.2\u001b[0m\u001b[39;49m -> \u001b[0m\u001b[32;49m24.0\u001b[0m\n",
      "\u001b[1m[\u001b[0m\u001b[34;49mnotice\u001b[0m\u001b[1;39;49m]\u001b[0m\u001b[39;49m To update, run: \u001b[0m\u001b[32;49mpip install --upgrade pip\u001b[0m\n"
     ]
    }
   ],
   "source": [
    "!pip install llama-index-readers-file\n",
    "!pip install openpyxl"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "85ff09fd-8a99-4aa4-8182-8d0cf30f7b85",
   "metadata": {},
   "outputs": [],
   "source": [
    "from llama_index.readers.file import PandasExcelReader\n",
    "import importlib\n",
    "from pathlib import Path\n",
    "\n",
    "base_reader = PandasExcelReader()\n",
    "base_docs = base_reader.load_data(Path(\"dcf_template.xlsx\"))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "ba45f806-58be-4f57-bf42-2721555136cb",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Discounted Cash Flow Excel Template           \n",
      "           \n",
      "Here is a simple discounted cash flow excel template for estimating your company value based on this income valuation approach           \n",
      "           \n",
      "Instructions:           \n",
      "1) Fill out the two assumptions in yellow highlight           \n",
      "2) Fill in either the 5 year or 3 year weighted average figures in yellow highlight           \n",
      "           \n",
      "           \n",
      "           \n",
      "           \n",
      "Assumptions           \n",
      "Tax Rate 0.2          \n",
      "Discount Rate 0.15          \n",
      "           \n",
      "5 Year Weighted Moving Average           \n",
      "Indication of Company Value 242995.4347636059          \n",
      "           \n",
      "3 Year Weighted Moving Average           \n",
      "Indication of Company Value 158651.0723286644          \n",
      "           \n",
      " 5 Year Weighted Moving Average          \n",
      " Past Years     Forecasted Future Years     \n",
      " Year 1 Year 2 Year 3 Year 4 Year 5 Year 6 Year 7 Year 8 Year 9 Year 10 Terminal Value\n",
      "Pre-tax income 50000 55000 45000 52000 60000      \n",
      "Income Taxes 10000 11000 9000 10400 12000      \n",
      "Net Income 40000 44000 36000 41600 48000      \n",
      "Depreciation Expense 5000 4000 3000 2000 1000      \n",
      "Capital Expenditures 10000 8000 5000 5000 7000      \n",
      "Debt Repayments 5000 5000 5000 5000 5000      \n",
      "Net Cash Flow 20000 27000 23000 29600 35000 29093.333333333332 29817.777777777774 30177.481481481478 30469.234567901232 30379.73991769547 287188.0007003137\n",
      "Discounting Factor      0.8695652173913044 0.7561436672967865 0.6575162324319883 0.5717532455930334 0.4971767352982899 0.4971767352982899\n",
      "Present Value of Future Cash Flow      25298.550724637684 22546.523839529513 19842.183927989798 17420.883754932976 15104.099911490972 142783.19260502496\n",
      "           \n",
      "           \n",
      " 3 Year Weighted Moving Average          \n",
      " Past Years   Forecasted Future Years       \n",
      " Year 1 Year 2 Year 3 Year 4 Year 5 Year 6 Terminal Value    \n",
      "Pre-tax income 50000 55000 45000        \n",
      "Income Taxes 10000 11000 9000        \n",
      "Net Income 40000 44000 36000        \n",
      "Depreciation Expense 5000 4000 3000        \n",
      "Capital Expenditures 10000 8000 5000        \n",
      "Debt Repayments 5000 5000 5000        \n",
      "Net Cash Flow 20000 27000 23000 23833.333333333332 24083.333333333332 23819.44444444444 158253.58851674633    \n",
      "Discounting Factor    0.8695652173913044 0.7561436672967865 0.6575162324319883 0.6575162324319883    \n",
      "Present Value of Future Cash Flow    20724.63768115942 18210.459987397608 15661.671369734164 104054.30329037321    \n",
      "           \n",
      "           \n",
      "Notes:           \n",
      "-We based this simple discounted cash flow excel model based on the weighted moving averages (5 year or 3 year) for simplicity, in case a constant growth rate cannot be easily determined.           \n",
      "-The factors such as Depreciation Expense, Capital Expense and Debt Repayments remain constant, so consider this when looking at the forecasted figures.           \n",
      "-For the terminal value constant growth rate, we make the assumption of the growth from the last forecasted year compared to the first forecasted year. Adjust in the formula as needed.           \n"
     ]
    }
   ],
   "source": [
    "print(base_docs[1].get_content())"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "ff6e812f-fa94-4b0f-8907-ee70983e53f1",
   "metadata": {},
   "outputs": [],
   "source": [
    "from llama_index.core import SummaryIndex\n",
    "\n",
    "base_index = SummaryIndex.from_documents([base_docs[1]])\n",
    "\n",
    "base_query_engine = base_index.as_query_engine()"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "fa75f1bc-6fed-4721-ba5e-dc5408395618",
   "metadata": {},
   "source": [
    "## Ask Questions over this Data\n",
    "\n",
    "Let's now ask questions over this data, using both the LlamaParse-powered pipeline and naive pipeline."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "a875a20e-a6b6-46b7-80d4-614546215ffc",
   "metadata": {},
   "outputs": [],
   "source": [
    "query_str = \"Tell me about the income taxes in the past years (year 3-5) for the 5 year WMA table\"\n",
    "response = query_engine.query(query_str)\n",
    "base_response = base_query_engine.query(query_str)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "06b0b072-f159-47c4-9cad-9f0cc0d56b28",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "******* LlamaParse RAG *******\n",
      "The income taxes in the past years (year 3 to 5) for the 5-year Weighted Moving Average table were $9,000.00 in Year 3, $10,400.00 in Year 4, and $12,000.00 in Year 5.\n",
      "******* Naive RAG *******\n",
      "The income taxes in the past years (year 3-5) for the 5 year WMA table were $9,000, $10,400, and $12,000, respectively.\n"
     ]
    }
   ],
   "source": [
    "print(\"******* LlamaParse RAG *******\")\n",
    "print(str(response))\n",
    "print(\"******* Naive RAG *******\")\n",
    "print(str(base_response))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "8bd0998f-4f7f-46f9-9b51-cfb510f384ee",
   "metadata": {},
   "outputs": [],
   "source": [
    "print(response.source_nodes[0].get_content())"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "7a93af5f-fcea-4f14-80eb-5dfad230cd8a",
   "metadata": {},
   "outputs": [],
   "source": [
    "query_str = \"Tell me about the discounting factors in year 5 for the 3 year WMA\"\n",
    "response = query_engine.query(query_str)\n",
    "base_response = base_query_engine.query(query_str)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "c6d3a5fb-c32c-4dea-8f2e-956af85456a4",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "******* LlamaParse RAG *******\n",
      "The discounting factor in year 5 for the 3-year Weighted Moving Average (WMA) is 0.7561.\n",
      "******* Naive RAG *******\n",
      "The discounting factor in year 5 for the 3-year Weighted Moving Average is 0.6575162324319883.\n"
     ]
    }
   ],
   "source": [
    "print(\"******* LlamaParse RAG *******\")\n",
    "print(str(response))\n",
    "print(\"******* Naive RAG *******\")\n",
    "print(str(base_response))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "b96f3a9b-6e99-4192-b6d6-447319d3c4fa",
   "metadata": {},
   "outputs": [],
   "source": [
    "query_str = \"Tell me about the projected net cash flow in years 7-9 for the 5 year WMA\"\n",
    "response = query_engine.query(query_str)\n",
    "base_response = base_query_engine.query(query_str)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "92b419b9-25ee-4d69-98d9-56c0a45b24af",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "******* LlamaParse RAG *******\n",
      "The projected net cash flow for years 7 to 9 in the 5-year Weighted Moving Average scenario is as follows: Year 7 is $29,817.78, Year 8 is $30,177.48, and Year 9 is $30,469.23.\n",
      "******* Naive RAG *******\n",
      "The projected net cash flow for years 7 to 9 in the 5-year weighted moving average scenario is as follows: Year 7 is $29,093.33, Year 8 is $29,817.78, and Year 9 is $30,177.48.\n"
     ]
    }
   ],
   "source": [
    "print(\"******* LlamaParse RAG *******\")\n",
    "print(str(response))\n",
    "print(\"******* Naive RAG *******\")\n",
    "print(str(base_response))"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "llama_parse",
   "language": "python",
   "name": "llama_parse"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
